var favoriteGenres: Set = ["Rock", "Classical", "Hip hop"] // 使用类型推断简化集合声明[^1]

@main 
struct RichTextApp: App {
    var body: some Scene {
        WindowGroup {
            let textElements = [
                Text("SwiftLee - A "),
                Text("weekly blog").bold(),
                Text(" about Swift, iOS and "),
                Text("Xcode Tips and Tricks").italic()
            ]
            
            VStack {
                ForEach(textElements.indices) { index in
                    if index == 0 {
                        textElements[index]
                    } else {
                        textElements[index - 1] + textElements[index]
                    }
                }.padding().multilineTextAlignment(.center)
            }
        }
    }
}